]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extension-tool: Don't treat missing .js handler as error
authorChuck <chuck@intelligence.org>
Thu, 19 Dec 2019 19:00:51 +0000 (11:00 -0800)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 20 Dec 2019 14:11:03 +0000 (14:11 +0000)
After creating a new extension, we try to open the main source
file with the default handler, which fails when there is none.

But given that the extension was created successfully, don't treat
a missing handler as failure, and print the path to the new extension
instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/905

subprojects/extensions-tool/src/command-create.c

index 13549643d8a5230960a86efa6f23a34fdba2442a..2c140bba0b45c48102d900670eea52866ec733db 100644 (file)
@@ -118,9 +118,14 @@ launch_extension_source (GFile *dir, GError **error)
   GList l;
 
   main_source = g_file_get_child (dir, "extension.js");
-  handler = g_file_query_default_handler (main_source, NULL, error);
+  handler = g_file_query_default_handler (main_source, NULL, NULL);
   if (handler == NULL)
-    return FALSE;
+    {
+      /* Translators: a file path to an extension directory */
+      g_print (_("The new extension was successfully created in %s.\n"),
+               g_file_peek_path (dir));
+      return TRUE;
+    }
 
   l.data = main_source;
   l.next = l.prev = NULL;